package main

import "fmt"

func main() {
	//phone := &Phone{}
	//phone.setName("华为")
	//phone.PrintName()
	//
	//clothes := &Clothes{}
	//clothes.setName("衣服")
	//clothes.PrintName()
	c := C{
		&A{"A"},
	}
	//fmt.Println(c.Name)
	fmt.Println(c.A)
	fmt.Println((*c.A).Name)

}

type A struct {
	Name string
}
type B struct {
	Name string
}
type C struct {
	*A
}

func (a *A) say() {
	fmt.Println(a.Name)
}

type Goods struct {
	Name  string
	Price float64
}

type Phone struct {
	Goods
	//内存
	memory int
}
type Clothes struct {
	Goods
	//风格
	style string
}

func (goods *Goods) PrintName() {
	fmt.Println(goods.Name)
}
func (goods *Goods) setName(name string) {
	goods.Name = name
}
